package com.micro.frog.acct.service;

import com.micro.frog.acct.dto.UserDTO;
import com.micro.frog.acct.entity.User;
import com.micro.frog.acct.vo.UserVO;
import com.micro.frog.core.common.PageResult;
import com.micro.frog.core.common.Result;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author :  ljh
 * @date : 2018/4/10
 **/
public interface UserService {

    /**
     * 验证是否已登录
     */
    boolean hasLogin(HttpServletRequest request);

    /**
     * 登录
     * @return
     */
    Result login(String loginName, String password, HttpServletRequest request, HttpServletResponse response);

    /**
     * 所有不分页
     * @return
     */
    List<UserVO> all();
    /**
     * 查询带分页
     * @return
     */
    PageResult list(UserDTO queryVO);

    /**
     * 添加用户
     * @return
     */
    Result add(UserVO userVO);

    /**
     * 删除用户
     * @return
     */
    int delete(Integer id);

    /**
     * 修改用户
     * @return
     */
    Result update(UserVO userVO) throws Exception;

    /**
     * 修改用户状态
     *
     * @return
     */
    Result updateStatus(User user) throws Exception;
}
